import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";

export default defineConfig(() => {
  return {
    plugins: [vue()],
    esbuild: {
      pure: true ? ["console.log", "debugger"] : [],
    },
    resolve: {
      alias: {
        "@": resolve(__dirname, "./src"),
        "vue-i18n": "vue-i18n/dist/vue-i18n.cjs.js",
      },
    },
    base: "./",
    server: {
      port: 3000,
      host: "0.0.0.0",
      open: true,
      proxy: {
        "/api": {
          target: "http://music.lyhotel.group",
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/api/, ""),
        },
      },
    },
  };
});
